Home > biomechZoo > Toolbox > Support Functions > explode.m

explode

PURPOSE ^

EXPLODE Splits string into pieces.

SYNOPSIS ^

function [split,numpieces]=explode(string,delimiters)

DESCRIPTION ^

 EXPLODE    Splits string into pieces.
   EXPLODE(STRING,DELIMITERS) returns a cell array with the pieces
   of STRING found between any of the characters in DELIMITERS.

   [SPLIT,NUMPIECES] = EXPLODE(STRING,DELIMITERS) also returns the
   number of pieces found in STRING.

   Input arguments:
      STRING - the string to split (string)
      DELIMITERS - the delimiter characters (string)
   Output arguments:
      SPLIT - the split string (cell array), each cell is a piece
      NUMPIECES - the number of pieces found (integer)

   Example:
      STRING = 'ab_c,d,e fgh'
      DELIMITERS = '_,'
      [SPLIT,NUMPIECES] = EXPLODE(STRING,DELIMITERS)
      SPLIT = 'ab'    'c'    'd'    'e fgh'
      NUMPIECES = 4

   See also IMPLODE, STRTOK

   Created: Sara Silva (sara@itqb.unl.pt) - 2002.04.30

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sun 10-Mar-2024 22:39:06 by m2html © 2005